﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Security.Cryptography;
using System.Text;

namespace SPCFMedicineInformer.Helpers
{
    public static class EncDecrypt
    {
        public static string ToEncryptedPassword(this string plainPassord)
        { 
            HMACSHA1 hash = new HMACSHA1();
            hash.Key = Encoding.Unicode.GetBytes(plainPassord);
            string hashedPassword = Convert.ToBase64String(hash.ComputeHash(Encoding.Unicode.GetBytes(plainPassord)));
            return hashedPassword;      
        }
    }
}